import request from '@/utils/request';

// 登录方法
export function login(username, password, code, uuid) {
  return request({
    url: '/auth/login',
    method: 'post',
    headers: {
      isToken: false
    },
    data: {
      username,
      password,
      code,
      uuid
    }
  });
}

// 注册方法
export function register(data) {
  return request({
    url: '/auth/register',
    method: 'post',
    headers: {
      isToken: false
    },
    data
  });
}

// 获取验证码
export function getCaptcha() {
  return request({
    url: '/code',
    method: 'get',
    headers: {
      isToken: false
    }
  });
}

// 刷新方法
export function refreshToken() {
  return request({
    url: '/auth/refresh',
    method: 'post'
  });
}

// 获取用户信息
export function getUserInfo() {
  return request({
    url: '/system/user/getInfo',
    method: 'get'
  });
}

// 退出登录
export function logout() {
  return request({
    url: '/auth/logout',
    method: 'delete'
  });
} 